jQuery(function(){
	jQuery('#username').attr('placeholder','请输入用户名');
	jQuery('#password').attr('placeholder','请输入密码');
	jQuery('#verifyCode').attr('placeholder','请输入验证码');
	jQuery('#kaptchaImage').click(function () {//生成验证码  
		jQuery(this).attr('src', '/captcha-image.do?' + Math.floor(Math.random()*100) ); 
        
	}) ;     
});

function login(){	
	var account = jQuery('#username').val();
	var password = jQuery('#password').val();
	var verifyCode = jQuery('#verifyCode').val();
	jQuery.post('/back/login.do',{account:account,password:password,verifyCode:verifyCode},function(rsp){
		if(rsp.errorCode == null){
			window.location.href='/back/index.do';
		}else{
			alert(rsp.errorMsg);
		}
	});
}

function refrsh(){
	jQuery('#kaptchaImage').click(function () {//生成验证码  
		jQuery(this).attr('src', '/captcha-image.do?' + Math.floor(Math.random()*100) ); 
        
	}) ;     
}
